//
//  ViewController.m
//  ATWaveAnimation
//
//  Created by 柳栗斌 on 16/8/6.
//  Copyright © 2016年 柳栗斌. All rights reserved.
//

#import "ViewController.h"
#import "Demo1ViewController.h"

@interface ViewController () <UITableViewDelegate,UITableViewDataSource,UINavigationBarDelegate>

@property (copy, nonatomic) NSArray *dataArr;//数据源

@property (weak, nonatomic) IBOutlet UITableView *tableView;//表示图

@end

static NSString *identify = @"cell";

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    
    [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:identify];
    
    self.dataArr = @[@"波浪形下载进度显示"];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (NSInteger )numberOfSectionsInTableView:(UITableView *)tableView{
    
    return 1;
}

- (NSInteger )tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return self.dataArr.count;
}

- (CGFloat )tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    return 50;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identify forIndexPath:indexPath];
    cell.textLabel.text = self.dataArr[indexPath.row];
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    if (indexPath.row == 0) {
        
        Demo1ViewController *demo1Vc = [[Demo1ViewController alloc]init];
        [self.navigationController pushViewController:demo1Vc animated:YES];
    }
    
}


@end
